<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="../template/index.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	<ui:define name="title">
		<title>Attendance Management</title>
		<script>
			$('document').ready(function() {
				$('#attendance-id').addClass("menu-left-selected");
			});
		</script>

	</ui:define>
	<ui:define name="lcontent">
		<title>Human Resource</title>
		<ui:include src="../template/menu-left/human-resources.xhtml"></ui:include>
	</ui:define>
	<ui:define name="rcontent">
		<f:event listener="#{attendanceManagement.onload}"
			type="preRenderView"></f:event>

		<div class="rcontent-main">
			<span class="input-table-caption">Tạo bảng chấm công</span>

			<h:form id="form1">
				<table class="input-table w100">
					<tr>
						<td>Tháng/năm</td>
						<td><h:selectOneMenu value="#{attendanceManagement.month}"
								valueChangeListener="#{attendanceManagement.checkDayOfMonth}"
								onchange="submit()">
								<f:selectItem itemValue="0" itemLabel="1"></f:selectItem>
								<f:selectItem itemValue="1" itemLabel="2"></f:selectItem>
								<f:selectItem itemValue="2" itemLabel="3"></f:selectItem>
								<f:selectItem itemValue="3" itemLabel="4"></f:selectItem>
								<f:selectItem itemValue="4" itemLabel="5"></f:selectItem>
								<f:selectItem itemValue="5" itemLabel="6"></f:selectItem>
								<f:selectItem itemValue="6" itemLabel="7"></f:selectItem>
								<f:selectItem itemValue="7" itemLabel="8"></f:selectItem>
								<f:selectItem itemValue="8" itemLabel="9"></f:selectItem>
								<f:selectItem itemValue="9" itemLabel="10"></f:selectItem>
								<f:selectItem itemValue="10" itemLabel="11"></f:selectItem>
								<f:selectItem itemValue="11" itemLabel="12"></f:selectItem>
							</h:selectOneMenu> / <h:selectOneMenu value="#{attendanceManagement.year}"
								valueChangeListener="#{attendanceManagement.checkDayOfMonth}"
								onchange="submit()">
								<f:selectItem itemValue="2011" itemLabel="2011"></f:selectItem>
								<f:selectItem itemValue="2012" itemLabel="2012"></f:selectItem>
								<f:selectItem itemValue="2013" itemLabel="2013"></f:selectItem>
								<f:selectItem itemValue="2014" itemLabel="2014"></f:selectItem>
							</h:selectOneMenu>
						</td>
					</tr>
					<tr>
						<td>Phòng Ban</td>
						<td><h:selectOneMenu>
								<f:selectItem itemLabel="Phòng Kinh Doanh"></f:selectItem>
								<f:selectItem itemLabel="Phòng Kế Toán"></f:selectItem>
								<f:selectItem itemLabel="Phòng Quản Lý Doanh Nghiệp"></f:selectItem>
							</h:selectOneMenu></td>
					</tr>
					<tr>
						<td></td>
						<td><h:commandButton styleClass="button" value="Tạo mới"
								action="#{attendanceManagement.gotoAddNew}"></h:commandButton>
						</td>
					</tr>
				</table>

			</h:form>

			<br /> <span class="input-table-caption">Danh sách chấm công</span>
			<h:form id="form2">
				<div class="main-content-table-panel">
					<table class="main-content-table">
						<tr>
							<th width="100px">Tháng/năm</th>
						</tr>
						<ui:repeat var="item" value="#{attendanceManagement.allAttendance}">
							<tr>
								<td>#{item.mh}/#{item.yr}</td>
							</tr>
						</ui:repeat>
					</table>
				</div>
			</h:form>
		</div>
	</ui:define>
</ui:composition>